package com.earthchen.demo.vo;

import java.util.ArrayList;
import java.util.List;

/**
 * tree 抽象节点 树可继承这个节点
 *
 * @author earthchen
 * @date 2018/9/7
 **/
public abstract class BaseTreeNodeVO {

    protected Long id;
    protected Long parentId;
    protected List<BaseTreeNodeVO> children = new ArrayList<>();

    public void addChilren(BaseTreeNodeVO node) {
        this.children.add(node);
    }

    public List<BaseTreeNodeVO> getChildren() {
        return children;
    }

    public void setChildren(List<BaseTreeNodeVO> children) {
        this.children = children;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
}
